package day0;
import java.util.Scanner;

import org.junit.Test;

public class Day3 {
	@Test
	public void test1() {
		for (int i = 1; i <= 10; i++) {
			if (i == 5) {
				continue;// 跳过这一次的循环继续下一次的循环
			}
			System.out.println(i);// 跳过5，直接蹦6
		}
		System.out.println("--------------");
	}

	@Test
	public void test2() {
		for (int i = 1; i <= 10; i++) {
			if (i == 5) {
				break;// 调出本层循环，直接终止最近的循环体以结束循环
			}
			System.out.println(i);// 循环到5结束
		}
	}
	
	@Test
	public void test3() {
		Scanner scanner =  new Scanner(System.in);
		int num = scanner.nextInt();
		switch(num) {
		case 1:
			System.out.println("1");
			break;
		case 2:
			System.out.println("2");
			break;
		case 3:
			System.out.println("3");
			break;
		case 4:
			System.out.println("4");
			break;
		}
	}
	
	@Test
	public void test4() {
		int[] array = new int[4];
		array[0] = 0;
		array[1] = 1;
		array[2] = 2;
		array[3] = 3;
		
		for (int i = 0 ; i < array.length ; i++) {
			System.out.println(array[i]);
			
		}
		
		System.out.println("*****************");
		
		for (int i = array.length - 1 ; i >= 0 ; i--) {
			System.out.println(array[i]);
			
		}
		
	}
	
	

}
